package com.example.demo.serviceimpl;

import com.example.demo.dao.DeviceMapper;
import com.example.demo.dao.MessageMapper;
import com.example.demo.dao.UserMapper;
import com.example.demo.pojo.DeviceEntity;
import com.example.demo.service.DeviceService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class DeviceServiceImpl implements DeviceService {
    @Autowired
    MessageMapper message ;

    @Autowired
    UserMapper user ;
    @Autowired
    DeviceMapper device;

    @Override
    public List<DeviceEntity> getAllDevice() {


        List<DeviceEntity> list=device.getAllDevice();
        return list;
    }

    @Override
    public DeviceEntity getByDeviceId(Integer deviceId) {
        return device.getByDeviceId(deviceId);
    }

    @Override
    public int insert(DeviceEntity entity) {
        return device.insert(entity);
    }

    @Override
    public int updateById(DeviceEntity entity) {

        return device.updateById(entity);
    }

    /*
    * 通过前端获取值来获取查询状态
    *
    *
    *
    * */
    public  List<DeviceEntity> getTypeDevice( String deviceType){
         String s="'"+deviceType+"'";
        List<DeviceEntity> list=device.getTypeDevice( deviceType);
       System.out.print("这是"+s+"\n");
        return list;
    }

}
